#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main() {
	int sz, i;
	int arr[] = { 2, 4, 5, 9, 10, 13, 43, 24, 17 };
	sz = (sizeof(arr) / sizeof(arr[0]));
	int left = 0;
	int right = sz - 1;
	while (left < right) {
		while (arr[left] % 2 != 0) {
			left++;
		}
		while (arr[right] % 2 == 0) {
			right--;
		}
		if (left < right) {

			int tmp = 0;
			tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
		}
	}
	for (i = 0; i < sz; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}